﻿
using System;
using System.Data;
using System.Collections.Generic;

namespace LDSP.BRL
{
    public partial class SystemUser : BYFW.BOL.BaseConfigEntity
    {
        public SystemUser()
        {
            m_tableName = "t_sysuser";
            m_hasCode = true;
            m_hasName = true;
            m_hasComment = true;
            m_tblCacheManager.IsEnable = true;
        }

        protected string m_password = string.Empty;

        /// <summary>
        /// 密码
        /// </summary>
        public string Password
        {
            get { return m_password; }
            set { m_password = value; }
        }

        /// <summary>
        /// 是否是超级用户
        /// </summary>
        public bool IsSuper
        {
            get;
            set;
        }

        protected override void FillContainer()
        {
            base.FillContainer();
            m_container.Add("password", m_password);
        }

        public override bool GetProperties(System.Data.DataRow record)
        {
            if (!base.GetProperties(record))
            {
                return false;
            }
            m_password = this.GetStringValue(record, "password");
            return true;
        }

        public override int Delete(string transID)
        {
            new R_SystemUserCatalog().DeleteBySystemUser(transID, m_id);
            return base.Delete(transID);
        }
    }
}
